package com.zhiketuan.webserver.model;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

/**
 * 所有控制层的响应输出模型
 *
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
public class Responses {

    public static ResponseEntity ok() {
        return new ResponseEntity(HttpStatus.OK);
    }

    public static ResponseEntity<ResponseResult> ok(ResponseResult result) {
        return new ResponseEntity(result, HttpStatus.OK);
    }

    public static ResponseEntity notFound() {
        return new ResponseEntity(HttpStatus.NOT_FOUND);
    }

    public static ResponseEntity<ResponseResult> serverError(ResponseResult result) {
        return new ResponseEntity(result, HttpStatus.INTERNAL_SERVER_ERROR);
    }
}
